/*
 * @Author: sdq 483657864@qq.com
 * @Date: 2025-04-18 11:01:16
 * @LastEditors: sdq 483657864@qq.com
 * @LastEditTime: 2025-04-18 13:56:18
 * @FilePath: \ranyu_anchor_new\src\agroa\listenter\userUnpublished.ts
 * @Description: 用户取消推流监听
 */
import { type IAgoraRTCRemoteUser } from "agora-rtc-sdk-ng";
export const agoraUnpublishedListener = async () => {
  // 动态导入，减少不必要的加载
  const { agoraClient } = await import("../initAgoraSdk");
  /**
   * @description 取消推流监听
   */
  const mountUnpublishedLister = () => {
    agoraClient.value?.on("user-unpublished", async (user: IAgoraRTCRemoteUser) => {
      agoraClient.value?.unsubscribe(user);
    });
  };
  return {
    mountUnpublishedLister,
  };
};
